package pl.edu.agh.inpema.core.components;

import java.util.Map;
import java.util.Set;

import pl.edu.agh.inpema.core.dataBase.DataBase;
import pl.edu.agh.inpema.core.queue.Queue;

public interface ReceiverUtil {

	/**
	 * sends message and notify all interested analyzers
	 * @param login author of this message
	 * @param messageFields map of message fields
	 */
	public void addMessage(String login, Map<String, String> messageFields);
	
	/**
	 * get receiver name
	 * @return receiver name
	 */
	public String getReceiverName();
	
	/**
	 * sets receiver name
	 * @param name receiver name
	 */
	public void setReceiverName(String name);
	
	/**
	 * adds analyzer as listener
	 * @param analazerName analyzer name
	 */
	public void addAnalazerListener(String analazerName);
	/**
	 * sets analyzer listener
	 * @param analazerNames set of analyzer names
	 */
	public void setAnalazerListeners(Set<String> analazerNames);
	/**
	 * get all analyzer listeners
	 * @return set of all analyzer listener names
	 */
	public Set<String> getAllAnalyzerNames();
	/**
	 * check if receiver has analyze listener
	 * @param analazerName analyzer listener
	 * @return true if receiver has this analyzer, false otherwise
	 */
	public boolean hasAnalazerListener(String analazerName);
	/**
	 * remove analyzer listener
	 * @param analazerName name of analyzer to remove
	 */
	public void removeAnalazerListener(String analazerName);
	/**
	 * remove all analyzer listeners
	 */
	public void removeAllListeners();
	
	/**
	 * sets the dataBase
	 * @param dataBase dataBase
	 */
	public void setDataBase(DataBase dataBase);
	
	/**
	 * sets the Queue
	 * @param queue queue
	 */
	public void setQueue(Queue queue);
	
}
